package cn.ibizlab.todo.api.config;

import com.alibaba.fastjson.JSON;
import lombok.Data;

@Data
public class Message {
    private String fromUser; // 发送人

    private String toUser;  // 接收人

    private String msg;  // 发送消息

    public String getFromUser() {
        return fromUser;
    }

    public Message setFromUser(String fromUser) {
        this.fromUser = fromUser;
        return this;
    }

    public String getToUser() {
        return toUser;
    }

    public Message setToUser(String toUser) {
        this.toUser = toUser;
        return this;
    }

    public Message(String fromUser, String toUser, String msg){
        this.fromUser = fromUser;
        this.toUser = toUser;
        this.msg = msg;
    }

    public static String jsonStr(String fromUser, String toUser, String msg){
        return JSON.toJSONString(new Message(fromUser,toUser,msg));
    }
}
